package com.cap.bts.crmdp.dealer.card.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.cap.bts.framework.common.domain.BaseDomain;


/**
 * The persistent class for the TM_CARD_GENERATION database table.
 * 
 */
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name="TM_CARD_GENERATION")
public class CardGeneration extends BaseDomain implements Serializable {
	private static final long serialVersionUID = 1L;

	private Long id;

	private CardDefinition cardDefinition;

	private String cardNumFrom;

	private String cardNumTo;

	private int quantity;

	public CardGeneration() {
	}
	
	
	
    /**
     * @Date        :      Aug 24, 2015
     * @param id
     * @param cardDefinition
     * @param cardNumFrom
     * @param cardNumTo
     * @param quantity
     */
    public CardGeneration(Long id, CardDefinition cardDefinition, String cardNumFrom,
        String cardNumTo, int quantity) {
        super();
        this.id = id;
        this.cardDefinition = cardDefinition;
        this.cardNumFrom = cardNumFrom;
        this.cardNumTo = cardNumTo;
        this.quantity = quantity;
    }

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}



	/**
     * @Date        :      Aug 19, 2015
     *
     * @return the cardDefinition
     */
    @ManyToOne(optional = false, targetEntity = CardDefinition.class)
    @JoinColumn(name = "CARD_DEF_ID", referencedColumnName = "ID")
    public CardDefinition getCardDefinition() {
        return cardDefinition;
    }

    /**
     * @Date        :      Aug 19, 2015
     *
     * @param cardDefinition the cardDefinition to set
     */
    public void setCardDefinition(CardDefinition cardDefinition) {
        this.cardDefinition = cardDefinition;
    }

    @Column(name="CARD_NUM_FROM")
	public String getCardNumFrom() {
		return this.cardNumFrom;
	}

	public void setCardNumFrom(String cardNumFrom) {
		this.cardNumFrom = cardNumFrom;
	}

	@Column(name="CARD_NUM_TO")
	public String getCardNumTo() {
		return this.cardNumTo;
	}

	public void setCardNumTo(String cardNumTo) {
		this.cardNumTo = cardNumTo;
	}

	public int getQuantity() {
		return this.quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

}